home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
SimulationMultiplexor.h,v
< prev
next >
Wrap
Text File
|
1989-10-26
|
2KB
|
142 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @ * @;
3.2
date 89.02.20.15.37.29; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.50.17; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.10.30.13.06.05; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#ifndef SimulationMultiplexor_h
#define SimulationMultiplexor_h
#include "CpuMultiplexor.h"
#include "HardwareContext.h"
//
// Like it says.
//
extern double CurrentSimulatedTime;
extern const double NullTime;
class SpinBarrier;
class TimeSchedulerPQ;
class SimulationMultiplexor : public CpuMultiplexor {
protected:
TimeSchedulerPQ *myPendingEvents;
SpinLock *myPendingEventsLock;
SpinBarrier *cpuBarrier;
virtual int advanceTime();
virtual void allocateLocalEventStructures(int,int);
virtual void allocateEventStructures(int,int);
virtual void deallocateEventStructures();
public:
SimulationMultiplexor(int debug = 0, int barrierMaxLoops = 0);
~SimulationMultiplexor();
virtual void warmThePot(int);
virtual void stirItAround();
virtual void coolItDown();
virtual void addAt(Thread *, double);
virtual void addWithDelay(Thread *, double);
virtual void hold( double time );
virtual void await( double time );
};
extern SimulationMultiplexor *ThisSimulationMultiplexor;
inline double simulatedClock() {
return( CurrentSimulatedTime );
}
inline void hold(double holdFor)
{
if (holdFor > 0) {
ThisSimulationMultiplexor -> await( CurrentSimulatedTime + holdFor );
}
}
inline void await(double till)
{
ThisSimulationMultiplexor -> await(till);
}
#endif /* SimulationMultiplexor_h */
@
3.1
log
@Steay version
@
text
@d20 1
d25 2
a26 1
AwesimeHeap *myPendingEvents;
@
1.1
log
@Initial revision
@
text
@d30 2
a31 1
virtual void allocateEventStructures(int);
d35 1
a35 1
SimulationMultiplexor(int debug = 0);
d54 1
a54 2
inline void
SimulationMultiplexor::hold(double holdFor)
d57 1
a57 1
await( CurrentSimulatedTime + holdFor );
a58 5
}
inline void hold(double holdFor)
{
ThisSimulationMultiplexor -> hold(holdFor);
@